//传统能耗相关接口
import api from '@/api/api'



// 根据设备类型获取传统能耗概况
const tradtionView = (type = 2) => {
	return api.get(`/tradition/homepage/homepageDataByType/${type}`, )
}


// 传统能耗用《水》排行统计
const tradtionWaterRank = (eqTypeCode = 2, day = "2025-01-21") => {
	return api.get(`/tradition/homepage/dosageRanking/?eqTypeCode=${eqTypeCode}&day=${day}`)
}

// 传统能耗用《电》排行统计
const tradtionEleRank = (type, day = "2025-01-21") => {
	return api.get(`/tradition/homepage/dosageRankingWatt/?&day=${day}`)
}

// 传统能耗用《燃气》排行统计
const tradtionGasRank = (eqTypeCode = 3, day = "2025-01-21") => {
	return api.get(`/tradition/homepage/dosageRanking/?eqTypeCode=${eqTypeCode}&day=${day}`)
}

// 传统能耗用《燃气》排行统计
const tradtionWeightRank = (type, day = "2025-01-21") => {
	return api.get(`/tradition/homepage/dosageRankingWatt/?day=${day}`)
}





// 传统能耗用《水》用途占比
const tradtionWaterRatio = (eqTypeCode = 2, year) => {
	return api.get(`/tradition/homepage/purposeProportion/?eqTypeCode=${eqTypeCode}&year=${year}`)
}

// 传统能耗用《水》环比统计
/**
 * mflag : 0:月 1:年
 */
const tradtionWaterStatistics = (eqTypeCode = 2, mflag = 0) => {
	return api.get(`/tradition/homepage/monthRatio/?eqTypeCode=${eqTypeCode}&mflag=${mflag}`)
}

// 传统能耗用《电》预览
const reqTradtionEleView = () => {
	return api.get(`/tradition/homepage/homepageDataByWatt`)
}

// 传统能耗用《水》预览
const reqTradtionWaterView = () => {
	return api.get(`/tradition/homepage/homepageDataByType/2`)
}
// 传统能耗用《燃》预览
const reqTradtionGasView = () => {
	return api.get(`/tradition/homepage/homepageDataByType/3`)
}


// 传统能耗用《重能耗》预览
const reqTradtionWeightView = () => {
	return api.get(`/tradition/homepage/homepageDataByWatt`)
}
// 传统能耗用《重能耗》预览
const reqTradtionOtherView = () => {
	return api.get(`/tradition/homepage/homeOtherByType/0`)
}

//《水》占比图
const reqWaterPro = (type =2, year) => {
	return api.get(`/tradition/homepage/purposeProportion?eqTypeCode=${type}&year=${year}`)
}

//《电》占比图
const reqElePro = (type, year) => {
	return api.get(`/tradition/homepage/purposeProportionWatt?year=${year}`)
}

//《燃气》占比图
const reqGasPro = (type =3, year) => {
	return api.get(`/tradition/homepage/purposeProportion?eqTypeCode=${type}&year=${year}`)
}

//《重能耗》占比图
const reqWeightPro = (type, year) => {
	return api.get(`/tradition/homepage/purposeProportionWatt?year=${year}`)
}

//《传统能耗》告警
const reqTraditionAlarm = (data) => {
	return api.post(`/tradition/alarminfo/page`, data)
}



const apiArr = [



	{
		value: 'tradtionWaterRatio',
		method: 'get'
	},
	{
		value: 'tradtionWaterStatistics',
		method: 'get'
	},
];

export {
	tradtionView,

	tradtionWaterRank,
	tradtionEleRank,
	tradtionGasRank,
	tradtionWeightRank,
	
	tradtionWaterRatio,
	reqTradtionEleView,
	reqTradtionWaterView,
	reqTradtionGasView,
	reqTradtionWeightView,
	reqTradtionOtherView,
	tradtionWaterStatistics,
	reqWaterPro,
	reqElePro,
	reqGasPro,
	reqWeightPro,
	reqTraditionAlarm,
	apiArr
};